import { browser } from '$app/environment';
export const ensurePortalContainer = (containerId:string) => {
    if (!browser) return undefined; 
    let container = document.getElementById(containerId);
    if (!container) {
        container = document.createElement('div');
        container.id = containerId;
        container.style.position = 'absolute';
        container.style.top = '0';
        container.style.left = '0';
        container.style.width = '0';
        container.style.height = '0';
        container.style.pointerEvents = 'none';
        document.body.appendChild(container);
    }
    return container;
}